<?php
import('Psg.Core');
import('Psg.Teryt');
if (!isset($email))
    $email = PSG_CURUSREMAIL;
$id = Psg\Core::getUserIdByMail($email);
?>
<div style="width: 190px;">
    <div style="float: left; width: 64px; height: 64px;">
        <a href="<?= Url::site('overview/profile/' . $id) ?>">
            <img src="<?= Url::site('images/getProfilePicture/' . $id) ?>" alt="" style="padding:0px; margin: 0px;"/>
        </a>
        <?php if ($email == PSG_CURUSREMAIL && !isset($overview)): ?>
            <span style="position: relative; background-color: white;" id="profileApletBigAnc" class="notice">
                <a href="<?= Url::site('settings/profile') ?>" id="profileApletBigAncx">zmień</a>
            </span>
        <?php endif; ?>
    </div>
    <div style="float:left; width: 120px; text-align: inherit;" class="notice profile">
        <strong>
            <?php
            $Info = \Psg\Core::getUserInfo($email);
            if ($Info['nick'] == "admin") {
                echo 'Administrator';
            } else {
                echo $Info['nick'];
            }
            ?>
        </strong><br/>
        <a href="<?= Url::site('overview/city/' . $Info['id_miasto']) ?>"><?= Psg\Teryt::getCityName($Info['id_miasto']) ?></a>,
        <a href="<?= Url::site('overview/state/' . $Info['id_woj']) ?>"><?= Psg\Teryt::getStateName($Info['id_woj']) ?></a>
        <hr/>
    </div>
    <div class="breakDiv"></div>
    <div style="width:100%" class="notice">
        <?php if (Psg\Core::getLastAction($email) > (time() - 5 * 60)): ?>
            <span class="onlineTxt">online</span>
        <?php endif; ?>
        <?php if (!Psg\Core::isUserEnabled($email)): ?>
            <span class="blockedTxt">zablokowany</span>
        <?php endif; ?>
    </div>
</div>